#!/bin/bash

BIN_PATH="/home/$(whoami)/.local/bin/"
ICN_PATH="/home/$(whoami)/.local/share/icons/"
DSK_PATH="/home/$(whoami)/.local/share/applications/"

if [ ! -d ${BIN_PATH} ]; then
    mkdir ${BIN_PATH}
fi

if [ ! -d ${ICN_PATH} ]; then
    mkdir ${ICN_PATH}
fi

if [ ! -d ${DSK_PATH} ]; then
    mkdir ${DSK_PATH}
fi

echo ""
echo "================================================================="
echo "copy qmcc into ${BIN_PATH}"
cp qmcc ${BIN_PATH}/qmcc

echo "copy share/qmcc.png into ${ICN_PAGTH}"
cp share/qmcc.png ${ICN_PATH}/qmcc.png

echo "copy qmcc.desktop into ${DSK_PATH}"
sed "s/USERNAME/$(whoami)/g" share/qmcc.desktop > share/.qmcc.desktop
#cp share/qmcc.desktop ${DSK_PATH}
cp share/.qmcc.desktop ${DSK_PATH}/qmcc.desktop

echo ""
echo "> Successfully installed ICS! <"
echo "================================================================="
